#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QCoreApplication>
#include <QMainWindow>
#include <QTreeWidget>
#include <QtSql/QSqlDatabase>
#include <QtSql/QSqlError>
#include "adminpage.h"
#include "dlg_addstu.h"
#include "page_login.h"
#include "stumysql.h"
QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    //virtual void keyPressEvent(QKeyEvent *event);

private slots:
    void onLoginSuccessful(const QString &username);

    void on_btn_exit_clicked();

    void onTreeItemClicked(QTreeWidgetItem *item, int column);

    void on_btn_simulation_clicked();

    void on_brn_add_clicked();

    void on_btn_clear_clicked();

    void on_btn_del_clicked();

    void on_btn_update_clicked();

    void on_btn_search_clicked();

private:
    void updateTable();

private:
    Ui::MainWindow *ui;
    Page_login m_dlgLogin;
    stumySql *m_ptrStumysql;
    QStringList m_lNames;
    Dlg_AddStu m_dlgAddStu;
    AdminPage *newPage;
};
#endif // MAINWINDOW_H
